package src.lab02.text27;

import com.sun.org.apache.xpath.internal.SourceTree;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by 12442 on 2017/11/2.
 */
public class Test {

    public static void main(String[] args) {

        int a=0;

        //从键盘输入一个整数

        Scanner scanner=new Scanner(System.in);

        System.out.println("Please input an int:");

        try {

            a = scanner.nextInt();
        }catch (InputMismatchException e){

            System.out.println("类型不匹配！！！");
        }
          finally {


            System.out.println("a=" + a);
        }
    }
}
